﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="cancel_course.aspx.cs" Inherits="cancel_course" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        .auto-style1 {
            text-align: center;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <div class="auto-style1">
    
        请选择专业：<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Smajor" DataValueField="Smajor" AutoPostBack="True">
        </asp:DropDownList>
    
        </div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT DISTINCT [Smajor] FROM [Student]"></asp:SqlDataSource>
    
    </div>
        <br />
        <center>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Sno,Cno" DataSourceID="SqlDataSource3" ForeColor="#333333" GridLines="None" AllowPaging="True" AllowSorting="True">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Sclass" HeaderText="班级" SortExpression="Sclass" />
                <asp:BoundField DataField="Sno" HeaderText="学号" SortExpression="Sno" ReadOnly="True" />
                <asp:BoundField DataField="Sname" HeaderText="姓名" SortExpression="Sname" />
                <asp:BoundField DataField="Cno" HeaderText="课程号" SortExpression="Cno" ReadOnly="True" />
                <asp:BoundField DataField="Cname" HeaderText="课程名" SortExpression="Cname" />
                <asp:HyperLinkField DataNavigateUrlFields="Sno,Cno,Sname,Cname" DataNavigateUrlFormatString="cancel_course_detail.aspx?Sno={0}&amp;Cno={1}&amp;Sname={2}&amp;Cname={3}" Text="退课" Target="_parent" />
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
            </center>

        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT Student.Sclass,Select_course.Sno,Student.Sname,Select_course.Cno,Course.Cname
FROM Select_course,Student,Course
WHERE Select_course.Sno=Student.Sno AND Select_course.Cno=Course.Cno AND Student.Smajor=@Smajor">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" Name="Smajor" PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
